package gui.menuItems;

import gui.Main.GUI;
import gui.newWindows.JoinWindow;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;

/**
 * Represents the Join session menu item presented in the Help menu
 * 
 * @author Matthew Smith
 */
public class JoinSessionMenuItem extends JMenuItem implements ActionListener {

	GUI main;

	/**
	 * Creates an Join session menu Item
	 * 
	 * @param main
	 */
	public JoinSessionMenuItem(GUI main) {
		this.main = main;

		init();
	}

	/**
	 * initializes the GUI components
	 */
	public void init() {
		this.setText("Join");

		this.addActionListener(this);
	}

	/**
	 * Action when menu item is pressed
	 */
	public void actionPerformed(ActionEvent e) {
		JoinWindow join = new JoinWindow(main, "Join a HyPeerWeb");
		join.setSize(350, 200);
		join.setResizable(false);
	}
}
